<template>
    <div class="layout-root  my-modal smalll-form focus-ico">
        <a-row  style="width: 100%;height: 100%; padding: 10px;background-color: rgb(229 229 229 / 50%);" justify="center">
            <a-col :span="12">
                <a-form :model="rf" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                    <a-form-item label="校正结果文件名">
                        <a-col :span="10">
                            <a-input v-model:value="rf.ename" />
                        </a-col>
                        <a-col :span="2" style="text-align: center;">
                            <span >*</span>
                        </a-col>
                        <a-col :span="10">
                            <a-input v-model:value="control_set.ctr_blkHei" />
                        </a-col>
                    </a-form-item>
                </a-form>
            </a-col>
            <a-col :span="12">
                <a-row  style="width: 100%;height: 100%;" class="right-span">
                    <a-col :span="16" style="width: 100%;">
                        <a-button type="primary" @click="pan_enable_change" size="small">生成调度单</a-button>
                    </a-col>
                    <a-col :span="8" style="width: 100%;">
                        <a-button type="primary" @click="pan_enable_change" size="small">开始校正</a-button>
                    </a-col>
                </a-row>
            </a-col>
        </a-row>
        <a-row  style="width: 100%;height: 100%; padding: 10px;background-color: rgb(229 229 229 / 50%);" justify="center">
            <a-col :span="12">
                <a-table :data-source="gcyx_data" :columns="gcyx_table_columns"
                class="task-table" size="small" :showHeader="true" tableLayout="fixed"
                :pagination="false"
                bordered rowKey="path">
                <template #bodyCell="{ text, record, index, column }"></template>
            </a-table>
            </a-col>
            <a-col :span="12">
                <a-table :data-source="rfyx_data" :columns="rfyx_table_columns"
                    class="task-table" size="small" :showHeader="true" tableLayout="fixed"
                    :pagination="false"
                    bordered rowKey="path">
                    <template #bodyCell="{ text, record, index, column }"></template>
                </a-table>
            </a-col>
        </a-row>
        <a-row  style="width: 100%;height: 100%; padding: 10px;background-color: rgb(229 229 229 / 50%);" justify="center">
            <a-col :span="24">
                <a-row  style="width: 100%;height: 100%;" class="right-span">
                    <a-divider>模型参数</a-divider>
                    <a-row  style="width: 100%;" >
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="沿轨阶数">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Interior_AlongOrder" size="small"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="使用DEM">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.cal_Interior_IsUsedDEM" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="垂轨阶数">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Interior_AcrossOrder" />
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-divider>纠正参数</a-divider>
                    <a-row  style="width: 100%;" >
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="使用DEM">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.cal_Exterior_IsUsedDEM" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="时间间隔(秒)">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Exterior_TimeInterval" :disabled="cal_set.cal_Exterior_dynamic_skeleton==1"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="提取骨架">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.cal_Exterior_dynamic_skeleton" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="道格拉斯阀值">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_Exterior_douglas" :disabled="cal_set.cal_Exterior_dynamic_skeleton==0"/>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="偏移角数">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Exterior_NumberofAngles" />
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="最小点数">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Exterior_minTps" />
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="平滑滤波半径">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_Exterior_moveAveSmoothWin" :disabled="cal_set.cal_Exterior_dynamic_skeleton==0"/>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-divider>定标共用</a-divider>
                    <a-row  style="width: 100%;" >
                        <a-col :span="24" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" autocomplete="off" class="smale-form">
                                <a-form-item label="外内交替次数" >
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_IterationNumber" />
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="控制DEM">
                                    <a-col :span="22">
                                        <a-input v-model:value="cal_set.cal_controlDEM" />
                                    </a-col>
                                    <a-col :span="1"></a-col>
                                    <a-col :span="1">
                                        <a-button @click="add_control_dem_dir" style="" size="small">
                                            <template #icon>
                                                <plus-outlined />
                                            </template>
                                        </a-button>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-divider>解算</a-divider>
                    <a-row  style="width: 100%;" >
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="最小交会角">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_min_intersection_angle" />
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="解算方法">
                                    <a-col :span="22" class="smale-select" >
                                        <a-select 
                                        v-model:value="cal_set.cal_solve_method" 
                                        style="width: 150px;" 
                                        :options="cal_solve_methods"
                                        dropdownClassName="smale-select-span"
                                        size="small" 
                                        :field-names="{ label: 'name', value: 'value' }">
                                        </a-select>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="阻尼阀值">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_lambda" :disabled="cal_set.cal_solve_method=='iccv'"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="选权迭代">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.cal_isUpdate_weight" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="定权系数">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_danish_coef"  :disabled="cal_set.cal_isUpdate_weight==0"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="采用虚拟控制点">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.cal_use_vGcp" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="虚拟控制权缩放比">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_vgcp_weight_scale" :disabled="cal_set.cal_use_vGcp==0"/>
                                    </a-col>
                                </a-form-item>
                                <!-- <a-form-item label="交会辅助DEM">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_baseDEM" />
                                    </a-col>
                                </a-form-item> -->
                            </a-form>
                        </a-col>
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="最大迭代数">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_max_iteration_num" />
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="iccv迭代次数">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_iccv_solve_times" :disabled="cal_set.cal_solve_method=='re'"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="">
                                </a-form-item>
                                <a-form-item label="最小值权">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_min_weight" :disabled="cal_set.cal_isUpdate_weight==0"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="">
                                </a-form-item>
                                <a-form-item label="单景虚拟控制数">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_number_of_vgcp" :disabled="cal_set.cal_use_vGcp==0"/>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="高程迭代限差">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_dh" />
                                    </a-col>
                                </a-form-item>
                                
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-row  style="width: 100%;" >
                        <a-col :span="24" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" autocomplete="off" class="smale-form">
                                <a-form-item label="交会辅助DEM">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.cal_baseDEM" />
                                    </a-col>
                                    <a-col :span="1"></a-col>
                                    <a-col :span="1">
                                        <a-button @click="add_intersection_dem_dir" style="" size="small">
                                            <template #icon>
                                                <plus-outlined />
                                            </template>
                                        </a-button>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-divider>其他设置</a-divider>
                    <a-row  style="width: 100%;" >
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="线程数">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.threadNum" />
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                        <a-col :span="12" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" class="smale-form">
                                <a-form-item label="多景匹配中间结果是否删除">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="cal_set.isDel" :options="yes_not" size="small"/>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                    <a-row  style="width: 100%;" >
                        <a-col :span="24" style="width: 100%;">
                            <a-form :model="cal_set" name="basic" :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" autocomplete="off" class="smale-form">
                                <a-form-item label="辅助DEM">
                                    <a-col :span="22" class="smale-radio">
                                        <a-input v-model:value="cal_set.auxDEM" />
                                    </a-col>
                                    <a-col :span="1"></a-col>
                                    <a-col :span="1">
                                        <a-button @click="add_a_dem_dir" style="" size="small">
                                            <template #icon>
                                                <plus-outlined />
                                            </template>
                                        </a-button>
                                    </a-col>
                                </a-form-item>
                                <a-form-item label="定标对象">
                                    <a-col :span="22" class="smale-radio">
                                        <a-radio-group v-model:value="system.targetPlanet" :options="targetPlanets" size="small"/>
                                    </a-col>
                                </a-form-item>
                            </a-form>
                        </a-col>
                    </a-row>
                </a-row>
            </a-col>
        </a-row>
    </div>
    <modal_select_server_dir />
</template>
<script>
import { defineAsyncComponent } from 'vue'
export default {
  data() {
    return {
        rf:{
            ename:"",
        },
        gcyx_data: [],
        gcyx_table_columns: [
            {
                title: '工程影像列表',
                dataIndex: 'path',
                align: 'center',
                width: '100%',
            },
        ],
        rfyx_data: [],
        rfyx_table_columns: [
            {
                title: '进行传感器校正影像列表',
                dataIndex: 'path',
                align: 'center',
                width: '90%',
            },
            {
                title: '载荷索引',
                dataIndex: 'index',
                align: 'center',
                width: '5%',
            },
            {
                title: '波段数',
                dataIndex: 'bandc',
                align: 'center',
                width: '50%',
            },
        ],
        sensor_correct:{
            SC_vrModel_OrbitInterpolation:"Poly_Ep", //Poly_Ep Lagrang_Ep
            SC_vrModel_orbitOrder:"3", 
            SC_vrModel_AttInterpolation:"Poly_Euler", //Linear_Quater Linear_Euler Poly_Euler Spline_Euler
            SC_vrModel_attOrder:"2",
            SC_vrModel_innerModel:"Direct", //Direct Distortion
            SC_vrModel_TimeInterpolation:"IdentyItegratime", //InterpolationTime IdentyItegratime 
            SC_vrModel_nSightTrackOrder:"1",
            SC_scParams_dh:"10",
            SC_scParams_isUsedDem:"1",
            SC_scParams_baseImgIndex:"0",
            SC_scParams_blkLines:"10000",
            SC_scParams_rpcNx:"200",
            SC_scParams_rpcNy:"200",
            SC_scParams_rpcNz:"3",
            SC_scParams_TinGridSize:"4",
            SC_scParams_isOutputRpcCheck:"1",
        },
        mitt_modal_select_server_dir_back_id:"",
    }
  },
  components: {
    modal_select_server_dir: defineAsyncComponent(() => import('@/components/common/modal_select_server_dir.vue')),
  },
  beforeUnmount() {
    this.$mitt.off('modal_select_server_dir_back',this.mitt_modal_select_server_dir_back_id);
  },
  mounted() {
    console.log("")
    this.mitt_modal_select_server_dir_back_id=this.$mitt.on('modal_select_server_dir_back', (type_select_dir) => {
      if (type_select_dir.type == 'cdem') {
        this.cal_set.cal_controlDEM = type_select_dir.val;
      }
      else if (type_select_dir.type == 'adem') {
        this.cal_set.auxDEM= type_select_dir.val
      }
      else if (type_select_dir.type == 'idem') {
        this.cal_set.cal_baseDEM = type_select_dir.val
      } 
      
    },this?.$?.uid);
  },
  methods: {
    add_control_dem_dir(){
        this.$mitt.emit('show_modal_select_server_dir', {
            type: 'cdem',
            showfile: false,
            avtive_dir: this.cal_set.cal_controlDEM,
            showfile_filter: ['.img', '.tif', '.tiff'],
        },this?.$?.uid);
    },
    add_intersection_dem_dir(){
        this.$mitt.emit('show_modal_select_server_dir', {
            type: 'idem',
            showfile: false,
            avtive_dir: this.cal_set.cal_baseDEM,
            showfile_filter: ['.img', '.tif', '.tiff'],
        },this?.$?.uid);
    },
    add_a_dem_dir(){
        this.$mitt.emit('show_modal_select_server_dir', {
            type: 'adem',
            showfile: false,
            avtive_dir: this.cal_set.auxDEM,
            showfile_filter: ['.img', '.tif', '.tiff'],
        },this?.$?.uid);
    },


  },
}
</script>
<style>
span.center{
    text-align: center;
    width: 100%;
    color: #4a85b8;
}
.smale-form .ant-form-item{
    margin-bottom: 2px;
}
.smale-form .ant-form-item-label > label{
    font-size: 10px;
    height: 25px;
}
.smale-form .ant-input{
    font-size: 10px;
}
.smale-form .smale-radio label {
    font-size: 10px;
}
.smale-select .ant-select {
    font-size: 10px;
}
.smale-select-span .ant-select-item{
    padding: 5px 12px;
    font-size: 10px;
    line-height: 12px;
    min-height: 25px;
}
.right-span .ant-divider-horizontal.ant-divider-with-text{
    font-size: 10px;
    font-weight: 800;
}
.right-span .ant-divider-horizontal.ant-divider-with-text::before, .ant-divider-horizontal.ant-divider-with-text::after{
    top: 0%;
}
.right-span .ant-divider-horizontal.ant-divider-with-text{
    margin: 0px 0;
}
.smale-form .ant-input {
    padding: 0px 0px;
}
.smale-form .ant-form-item-control-input{
    min-height: 20px;
}
</style>